package com.sise.service.impl;


import com.sise.dao.TextDetectionMapper;
import com.sise.dto.TextDetectionDTO;
import com.sise.model.po.TextDetectionPO;
import com.sise.service.TextDetectionService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author idea
 * @data 2019/6/7
 */
@Service
public class TextDetectionServiceImpl implements TextDetectionService {

    @Autowired
    private TextDetectionMapper textDetectionMapper;


    /**
     * 记录存储过敏词汇
     *
     * @param textDetectionDTO 敏感词汇DTO
     * @return
     */
    @Override
    public boolean saveOne(TextDetectionDTO textDetectionDTO){
        if(textDetectionDTO==null){
            return false;
        }
        TextDetectionPO textDetectionPO=new TextDetectionPO();
        BeanUtils.copyProperties(textDetectionDTO,textDetectionPO);
        textDetectionMapper.insert(textDetectionPO);
        return true;
    }

}
